package com.one.controller;


import com.one.bo.CourseBo;
import com.one.bo.ElectiveBo;
import com.one.dto.Result;
import com.one.entity.ElectiveInfoEntity;
import com.one.entity.SysCourseEntity;
import com.one.service.ElectiveInfoService;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author zwj
 * @since 2021-10-14
 */
@RestController
@RequestMapping("/elective-info-entity")
public class ElectiveInfoController {

    private final ElectiveInfoService electiveInfoService;

    public ElectiveInfoController(ElectiveInfoService electiveInfoService) {
        this.electiveInfoService = electiveInfoService;
    }


    @ApiOperation(value = "添加课程", notes = "添加课程")
    @PostMapping("/addElective")
    public Result addElective(@RequestBody ElectiveInfoEntity electiveInfoEntity) {
        return electiveInfoService.addElecivr(electiveInfoEntity);
    }

    //根据学院标号和名称查询学院
    @ApiOperation(value = "查询授课信息", notes = "查询授课信息")
    @PostMapping("/selectElective")
    public Result selectElective(@RequestBody ElectiveBo ebo){
        return electiveInfoService.selectElective(ebo);
    }

    //删除课程
    @ApiOperation(value = "删除授课信息", notes = "删除授课信息")
    @PostMapping("/deleteElective")
    public Result deleteElective(@RequestBody ElectiveInfoEntity electiveInfoEntity) {
        return electiveInfoService.deleteElective(electiveInfoEntity);
    }

    @ApiOperation(value = "修改授课信息", notes = "修改授课信息")
    @PostMapping("/updateElective")
    public Result updateElective(@RequestBody ElectiveInfoEntity electiveInfoEntity) {
        return electiveInfoService.updateElective(electiveInfoEntity);
    }
}

